package com.zhang.search.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhang.common.model.SkuEsModel;
import com.zhang.common.dto.SkuSearchDto;
import com.zhang.common.model.SkuRecommendModel;

import java.io.IOException;
import java.util.List;

public interface IProductElasticSearchService {
    /**
     * 商品上架功能（存入ES）中
     *
     * @param skuEsModels
     * @return void
     * @throws IOException
     */
    void productUp(List<SkuEsModel> skuEsModels) throws IOException;

    /**
     * 从elasticSearch中搜索sku
     *
     * @param skuSearchDto
     * @return {@link List}<{@link SkuEsModel}>
     * @throws IOException
     */
    List<SkuEsModel> getSkuFromES(SkuSearchDto skuSearchDto) throws IOException;

    List<SkuEsModel> getSkuListByAdvice(SkuRecommendModel skuRecommendModel) throws IOException;

    /**
     * 更新一个Sku的销量
     *
     * @param skuId
     * @param quantity
     */
    void updateSkuSaleCount(String skuId, Integer quantity) throws IOException;

//    void updateSkuRating();

}
